//
//  MHUIKit.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/10/30.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHUIKit.h"

@implementation MHUIKit

@end
@implementation MHUIKit (MHLabel)
+(YYLabel *) cofigYYLableWithTextColor:(UIColor *)textColor font:(UIFont *) font numberOfLines:(int) numberOfLines backgroundColor:(UIColor *)backgroundColor
{
    YYLabel *commonLabel = [[YYLabel alloc] init];
    commonLabel.backgroundColor = backgroundColor?:[UIColor clearColor];
    commonLabel.numberOfLines = numberOfLines;
    commonLabel.textColor =  textColor;
    commonLabel.textAlignment = NSTextAlignmentLeft;
    commonLabel.font = font;
    commonLabel.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    commonLabel.displaysAsynchronously = YES;
    commonLabel.ignoreCommonProperties = NO;
    commonLabel.fadeOnAsynchronouslyDisplay = NO;
    commonLabel.fadeOnHighlight = NO;
    return commonLabel;
}

+(YYTextLayout *)configLabelTextLayoutWithLimitWidth:(CGFloat) limitWidth attristr:(NSAttributedString *) attristr maximumNumberOfRows:(int) maximumNumberOfRows{
    YYTextContainer *screenNameLableContainer = [YYTextContainer containerWithSize:CGSizeMake(limitWidth, MAXFLOAT)];
    screenNameLableContainer.maximumNumberOfRows = maximumNumberOfRows;
    YYTextLayout *screenNameLableLayout = [YYTextLayout layoutWithContainer:screenNameLableContainer text:attristr.copy];
    return screenNameLableLayout;

}

@end
